package com.fan.txl.di.module;

import com.fan.txl.BuildConfig;
import com.fan.txl.mock.api.service.APIService;
import com.fan.txl.mock.api.service.impl.APIServiceImpl;
import com.fan.txl.mock.api.service.impl.MockAPIServiceImpl;
import com.fan.txl.mock.api.service.mock.MockAPIService;

import java.util.concurrent.TimeUnit;
import javax.inject.Named;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import retrofit2.Retrofit;
import retrofit2.mock.BehaviorDelegate;
import retrofit2.mock.MockRetrofit;
import retrofit2.mock.NetworkBehavior;

/**
 * Created by jiajiabao on 17-1-21.
 */

@Module
@SuppressWarnings("unused")
public class APIModule {



    public APIModule(){
    }
    @Provides
    @Singleton
    APIService provideAPIService(Retrofit mRetrofit) {
       return new APIServiceImpl(mRetrofit);
    }

    @Provides
    @Singleton
    MockAPIService provideMockAPIService(Retrofit mRetrofit) {
        return new MockAPIServiceImpl(mRetrofit);
    }

    @Provides
    @Singleton
    @Named("backend")
    public String provideBackend() {
        return BuildConfig.api;
    }

}
